/*
 * Copyright (c) 2023, 2024,yzc.cn All rights reserved.
 *
 */
package cn.yzc.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;

/**
 * <p>Project: SpringColud - TokenAuthRequestInterceptor</p>
 * <p>Powered by yzc On 2024-01-02 14:46:25</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
public class TokenAuthRequestInterceptor implements RequestInterceptor {
    String token;

    public TokenAuthRequestInterceptor(String token) {
        this.token = token;
    }

    @Override
    public void apply(RequestTemplate requestTemplate) {
        //将token加入请求头
        requestTemplate.header("x-token",token);
    }
}
